<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewpoint" content="width=device-width, initial-scale=1.0">
    <title>搜索结果</title>
    <link href="https://cdn.bootcss.com/semantic-ui/2.4.1/semantic.min.css" rel="stylesheet">
    <link href="../static/css/myCss.css" rel="stylesheet">
</head>
<body>
<nav th:replace="_fragments :: menu(1)" class="ui inverted attached segment my-padding-tb-mini my-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary menu stackable">
            <h2 class="ui header teal item">Blog</h2>
            <a href="#" class="my-item item my-mobile-hide">首页</a>
            <a href="#" class="active my-item item my-mobile-hide">标签</a>
            <a href="#" class="my-item item my-mobile-hide">分类</a>
            <a href="#" class="my-item item my-mobile-hide">归档</a>
            <a href="#" class="my-item item my-mobile-hide">关于我</a>

            <div class="right item">
                <form name="form" method="post" action="#" target="_blank">
                    <div>
                        <div class="ui icon inverted transparent input">
                            <input name="query" type="text" placeholder="搜索">
                            <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                        </div>
                    </div>
                </form>

                <button class="ui button" style="margin-left: 1em !important;">注册/登陆</button>
            </div>

        </div>
    </div>
    <a href="#" class="menu tooggle ui icon black button my-top-right my-mobile-show"><i class="sidebar icon"></i></a>
</nav>


<div class="my-padded-tb-big my-container-small">
    <div class="ui container">
        <!--        头部 header-->
        <div class="ui segment top attached animated fadeInUp">
            <div class="ui middle aligned two column grid  ">
                <div class="column">
                    <div class="ui teal header">搜索结果</div>
                </div>

                <!--标签总量-->
                <div class="right aligned column">
                    共 <span id="article-number" class="ui header orange" th:text="${page.totalElements}">需要替代文字</span>个
                </div>
            </div>
        </div>

        <!--文章列表-->
        <div class="ui segment top attached teal animated fadeInUp">
            <!--文章-->
            <div class="ui vertical segment" th:each="blog : ${page.content}">
                <div class="ui grid stackable mobile reversed">
                    <!--文章相关信息-->
                    <div class="eleven wide column">
                        <!--card article-->
                        <!--文章题目和简介-->
                        <h3 class="ui header"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="m-black" th:text="${blog.title}">SpringMVC--二、SpringMVC请求参数绑定和常用注解</a></h3>
                        <p th:text="|${blog.description}......|">请求参数绑定绑定机制我们都知道，表单中请求参数都是基于key = value的。</p>
                        <div class="column">
                            <div class="ui stackable grid">
                                <div class="eleven wide column">
                                    <div class="ui horizontal link list">

                                        <!--作者头像和作者名-->
                                        <div class="item">
                                            <img src="https://picsum.photos/id/10/100" class="ui avatar image" th:src="@{${blog.user.avatar}}" alt="">
                                            <div class="content name"><a href="#" th:text="${blog.user.nickname}">张泽</a></div>

                                        </div>
                                        <!--文章上传时间-->
                                        <div class="item">
                                            <i class="calendar icon"></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2017-10-01</span>
                                        </div>

                                        <!--浏览量-->
                                        <div class="item">
                                            <i class="eye icon"></i> <span th:text="${blog.viewNum}">2342</span>
                                        </div>
                                    </div>
                                </div>

                                <!--文章tag-->
                                <div class="five wide column right aligned">
                                    <a href="#" target="_blank" class="ui label teal basic" th:text="${blog.type.typeName}">JavaWeb</a>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--footer-->
        <div class="ui segment bottom attached " th:if="${page.totalPages}>1">
            <div class="ui two column grid">
                <div class="ui column">
                    <a href="#" th:href="@{/(page=${page.number}-1)}"  th:unless="${page.first}" class="ui mini teal basic button">上一页</a>
                </div>
                <div class="right aligned column">
                    <a href="#" th:href="@{/(page=${page.number}+1)}"  th:unless="${page.last}" class="ui mini teal basic button">下一页</a>
                </div>
            </div>

        </div>
    </div>
</div>
<br><br><br><br>

<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/semantic-ui/2.4.1/semantic.min.js"></script>
<script>
    $('.menu.tooggle').click(function () {
        $('.my-item').toggleClass('my-mobile-hide');
    });
</script>
</body>
</html>